package com.huahang.fashionpress.enums;

import lombok.Getter;

/**
 * 异常类枚举
 * @author : 王翰聪
 * @since : 2019/08/21
 * @version : 1.0
 * @version : 1.1
 */

@Getter
public enum ExceptionEnum {
    PASSWORD_ERROR(1, "密码错误"),
    USERNAME_ERROR(2, "用户名错误"),
    DATA_ERROR(3,"数据出错"),
    ADMIN_NOT_EXIT(4,"管理员不存在"),
    PRODUCT_NOT_EXIT(5,"商品不存在"),
    IMG_NOT_EXIT(6,"图片不存在"),
    PARAM_ERROR(7,"参数错误"),
    RE_ERROR(8,"存在相同数据"),
    LATER_ERROR(9,"存在下级数据"),
    CATEGORY_NOT_EXIT(10,"该分类不存在"),
    FILE_TO_ERROR(11,"文件上传失败"),
    FILE_TO_SAVE_ERROR(12,"文件保存失败"),
    USERNAME_REPEATE(13, "用户名重复"),
    CHECK_NAME_ERROR(14,"用户名错误"),
    CHECK_PHONE_ERROR(15,"手机号错误"),
    ADMIN_NOT_LOGIN(15,"管理员没有登录"),
    PRODUCT_IS_NOT_EXSIST(16, "购物车中没有这个商品"),
    CART_EMPTY(17, "购物车为空"),
    CART_ERROR(18, "删除购物车时的未知错误"),
    PRODUCT_ALREADY_EXSIST(19, "商品已经在购物车中了"),
    TOO_MANY_ADDRESS(20, "用户地址过多"),
    ADDRESS_ALREADY_EXSIST(21, "地址已经存在了"),
    ADDRESS_ERROR(22, "地址操作未知错误"),
    EMAIL_REPEATE(23,"邮箱重复"),
    PHONE_REPEATE(24,"电话重复"),
    NOT_LOGIN_CLIENT(25,"没有登录"),
    NOT_EXIT_ROLE(26,"您没有权限"),
    ;

    private int code;
    private String msg;

    ExceptionEnum(int code, String msg){
        this.code = code;
        this.msg = msg;
    }
}
